import 'exceptions.dart';

/// 登录异常
class LoginException extends UnauthorizedException {
  LoginException([String message = '登录失败，请检查用户名和密码'])
      : super(message, code: 'LOGIN_FAILED');
}

/// 注册异常
class RegisterException extends BusinessException {
  RegisterException([String message = '注册失败，请稍后重试'])
      : super(message, code: 'REGISTER_FAILED');
}

/// 设备离线异常
class DeviceOfflineException extends BusinessException {
  DeviceOfflineException([String message = '设备离线，请检查设备连接状态'])
      : super(message, code: 'DEVICE_OFFLINE');
}

/// 设备连接异常
class DeviceConnectionException extends BusinessException {
  DeviceConnectionException([String message = '设备连接失败，请稍后重试'])
      : super(message, code: 'DEVICE_CONNECTION_FAILED');
}

/// 会话过期异常
class SessionExpiredException extends UnauthorizedException {
  SessionExpiredException([String message = '会话已过期，请重新登录'])
      : super(message, code: 'SESSION_EXPIRED');
}

/// 权限拒绝异常
class PermissionDeniedException extends BusinessException {
  PermissionDeniedException([String message = '权限不足，无法执行此操作'])
      : super(message, code: 'PERMISSION_DENIED');
}

/// 数据同步异常
class DataSyncException extends BusinessException {
  DataSyncException([String message = '数据同步失败，请稍后重试'])
      : super(message, code: 'DATA_SYNC_FAILED');
}

/// 设备故障异常
class DeviceMalfunctionException extends BusinessException {
  DeviceMalfunctionException([String message = '设备出现故障，请联系技术支持'])
      : super(message, code: 'DEVICE_MALFUNCTION');
} 